package com.rui.shangXueTang.kruskal;

/**
 * @author : [锐神NO.3]
 * @version : [v1.0]
 * @className : HanoiTower
 * @createTime : [2022/2/19 15:33]
 * @description : [描述该类的功能]
 */

public class HanoiTower {

    public static void main(String[] args) {
        hanoiTower(10, 'A', 'B', 'C');
    }

    public static void hanoiTower(int nums, char a, char b, char c) {
        if(nums == 1){
            System.out.println("第" + nums + "个盘子从" + a + "移动到" + c);
        }else {
            //把a先移动到了b
            hanoiTower(nums - 1, a, c, b);
            System.out.println("第" + nums + "个盘子从" + a + "移动到" + c);
            hanoiTower(nums - 1, b, a, c);
        }
    }
}
